<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Core  Reference</title>
    <link rel="stylesheet" type="text/css" href="css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="css/highlight.css" />
    <meta charset="utf-8">
    <script src="js/jquery.min.js" defer></script>
    <script src="js/jazzy.js" defer></script>
    
    <script src="js/lunr.min.js" defer></script>
    <script src="js/typeahead.jquery.js" defer></script>
    <script src="js/jazzy.search.js" defer></script>
  </head>
  <body>

    <a name="//apple_ref/swift/Section/Core" class="dashAnchor"></a>

    <a title="Core  Reference"></a>

    <header class="header">
      <p class="header-col header-col--primary">
        <a class="header-link" href="index.html">
          ChatLayout 2.2.2 Docs
        </a>
         (100% documented)
      </p>
    
      <div class="header-col--secondary">
        <form role="search" action="search.json">
          <input type="text" placeholder="Search documentation" data-typeahead>
        </form>
      </div>
    
    
    </header>

    <p class="breadcrumbs">
      <a class="breadcrumb" href="index.html">ChatLayout</a>
      <img class="carat" src="img/carat.png" alt=""/>
      Core  Reference
    </p>

    <div class="content-wrapper">
      <nav class="navigation">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Core.html">Core</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/CollectionViewChatLayout.html">CollectionViewChatLayout</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/ChatLayoutDelegate.html">ChatLayoutDelegate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/ChatLayoutAttributes.html">ChatLayoutAttributes</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/ChatLayoutSettings.html">ChatLayoutSettings</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/ChatLayoutSettings/PinneableItems.html">– PinneableItems</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/ChatLayoutPositionSnapshot.html">ChatLayoutPositionSnapshot</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/ChatLayoutPositionSnapshot/Edge.html">– Edge</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/ChatLayoutInvalidationContext.html">ChatLayoutInvalidationContext</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/ItemKind.html">ItemKind</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/ItemSize.html">ItemSize</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/ItemSize/CaseType.html">– CaseType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/ChatItemAlignment.html">ChatItemAlignment</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/ChatItemPinningType.html">ChatItemPinningType</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/InitialAttributesRequestType.html">InitialAttributesRequestType</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Extras.html">Extras</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/ContainerCollectionViewCell.html">ContainerCollectionViewCell</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/ContainerCollectionViewCellDelegate.html">ContainerCollectionViewCellDelegate</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/ContainerCollectionReusableView.html">ContainerCollectionReusableView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/MessageContainerView.html">MessageContainerView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/CellLayoutContainerView.html">CellLayoutContainerView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/CellLayoutContainerViewAlignment.html">CellLayoutContainerViewAlignment</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/EdgeAligningView.html">EdgeAligningView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/EdgeAligningView/Edge.html">– Edge</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SwappingContainerView.html">SwappingContainerView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SwappingContainerView/Axis.html">– Axis</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/SwappingContainerView/Distribution.html">– Distribution</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/ImageMaskedView.html">ImageMaskedView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Enums/ImageMaskedViewTransformation.html">ImageMaskedViewTransformation</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Classes/RoundedCornersContainerView.html">RoundedCornersContainerView</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Protocols/StaticViewFactory.html">StaticViewFactory</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/VoidViewFactory.html">VoidViewFactory</a>
              </li>
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="Structs/VoidViewFactory.html#/s:10ChatLayout15VoidViewFactoryV0cD0C">– VoidView</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a class="nav-group-name-link" href="Other%20Guides.html">Other Guides</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a class="nav-group-task-link" href="readme.html">README</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">

        <section class="section">
          <div class="section-content top-matter">
            <h1>Core</h1>
            
          </div>
        </section>

        <section class="section">
          <div class="section-content">
            <div class="task-group">
              <ul class="item-container">
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@M@ChatLayout@objc(cs)CollectionViewChatLayout"></a>
                    <a name="//apple_ref/swift/Class/CollectionViewChatLayout" class="dashAnchor"></a>
                    <a class="token" href="#/c:@M@ChatLayout@objc(cs)CollectionViewChatLayout">CollectionViewChatLayout</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>A custom collection view layout designed to present items in a grid-like format, similar to UITableView, while aligning content to
either the leading or trailing edge of the UICollectionView. This layout supports chat-style interfaces by preserving a consistent
content offset from the bottom. It also accommodates self-sizing cells and supplementary views, ensuring dynamic and responsive
content presentation.</p>
<h3 id='custom-properties' class='heading'>Custom Properties:</h3>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C8delegateAA0aB8Delegate_pSgvp">CollectionViewChatLayout.delegate</a></code></p>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C8settingsAA0aB8SettingsVvp">CollectionViewChatLayout.settings</a></code></p>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C39keepContentOffsetAtBottomOnBatchUpdatesSbvp">CollectionViewChatLayout.keepContentOffsetAtBottomOnBatchUpdates</a></code></p>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C45processOnlyVisibleItemsOnAnimatedBatchUpdatesSbvp">CollectionViewChatLayout.processOnlyVisibleItemsOnAnimatedBatchUpdates</a></code></p>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C32keepContentAtBottomOfVisibleAreaSbvp">CollectionViewChatLayout.keepContentAtBottomOfVisibleArea</a></code></p>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C13visibleBoundsSo6CGRectVvp">CollectionViewChatLayout.visibleBounds</a></code></p>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C11layoutFrameSo6CGRectVvp">CollectionViewChatLayout.layoutFrame</a></code></p>
<h3 id='custom-methods' class='heading'>Custom Methods:</h3>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C24getContentOffsetSnapshot4fromAA0ab8PositionH0VSgAG4EdgeO_tF">CollectionViewChatLayout.getContentOffsetSnapshot(...)</a></code></p>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C20restoreContentOffset4withyAA0aB16PositionSnapshotV_tF">CollectionViewChatLayout.restoreContentOffset(...)</a></code></p>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C16reconfigureItems2atySay10Foundation9IndexPathVG_tF">CollectionViewChatLayout.reconfigureItems(...)</a></code></p>

<p><code><a href="Classes/CollectionViewChatLayout.html#/s:10ChatLayout014CollectionViewaB0C23indexPathForItePinnedAty10Foundation05IndexF0VSgAA0A15ItemPinningTypeOF">CollectionViewChatLayout.indexPathForItePinnedAt(...)</a></code></p>

                        <a href="Classes/CollectionViewChatLayout.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@MainActor</span>
<span class="kd">open</span> <span class="kd">class</span> <span class="kt">CollectionViewChatLayout</span> <span class="p">:</span> <span class="kt">UICollectionViewLayout</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:10ChatLayout0aB8DelegateP"></a>
                    <a name="//apple_ref/swift/Protocol/ChatLayoutDelegate" class="dashAnchor"></a>
                    <a class="token" href="#/s:10ChatLayout0aB8DelegateP">ChatLayoutDelegate</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p><code><a href="Classes/CollectionViewChatLayout.html">CollectionViewChatLayout</a></code> delegate</p>

                        <a href="Protocols/ChatLayoutDelegate.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@MainActor</span>
<span class="kd">public</span> <span class="kd">protocol</span> <span class="kt">ChatLayoutDelegate</span> <span class="p">:</span> <span class="kt">AnyObject</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@M@ChatLayout@objc(cs)ChatLayoutAttributes"></a>
                    <a name="//apple_ref/swift/Class/ChatLayoutAttributes" class="dashAnchor"></a>
                    <a class="token" href="#/c:@M@ChatLayout@objc(cs)ChatLayoutAttributes">ChatLayoutAttributes</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Custom implementation of <code>UICollectionViewLayoutAttributes</code></p>

                        <a href="Classes/ChatLayoutAttributes.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@MainActor</span>
<span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">ChatLayoutAttributes</span> <span class="p">:</span> <span class="kt">UICollectionViewLayoutAttributes</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:10ChatLayout0aB8SettingsV"></a>
                    <a name="//apple_ref/swift/Struct/ChatLayoutSettings" class="dashAnchor"></a>
                    <a class="token" href="#/s:10ChatLayout0aB8SettingsV">ChatLayoutSettings</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p><code><a href="Classes/CollectionViewChatLayout.html">CollectionViewChatLayout</a></code> settings.</p>

                        <a href="Structs/ChatLayoutSettings.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">ChatLayoutSettings</span> <span class="p">:</span> <span class="kt">Equatable</span><span class="p">,</span> <span class="kt">Sendable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:10ChatLayout0aB16PositionSnapshotV"></a>
                    <a name="//apple_ref/swift/Struct/ChatLayoutPositionSnapshot" class="dashAnchor"></a>
                    <a class="token" href="#/s:10ChatLayout0aB16PositionSnapshotV">ChatLayoutPositionSnapshot</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Represents content offset position expressed by the specific item and it offset from the top or bottom edge.</p>

                        <a href="Structs/ChatLayoutPositionSnapshot.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">ChatLayoutPositionSnapshot</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">Sendable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/c:@M@ChatLayout@objc(cs)ChatLayoutInvalidationContext"></a>
                    <a name="//apple_ref/swift/Class/ChatLayoutInvalidationContext" class="dashAnchor"></a>
                    <a class="token" href="#/c:@M@ChatLayout@objc(cs)ChatLayoutInvalidationContext">ChatLayoutInvalidationContext</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Custom implementation of <code>UICollectionViewLayoutInvalidationContext</code></p>

                        <a href="Classes/ChatLayoutInvalidationContext.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@MainActor</span>
<span class="kd">public</span> <span class="kd">final</span> <span class="kd">class</span> <span class="kt">ChatLayoutInvalidationContext</span> <span class="p">:</span> <span class="kt">UICollectionViewLayoutInvalidationContext</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:10ChatLayout8ItemKindO"></a>
                    <a name="//apple_ref/swift/Enum/ItemKind" class="dashAnchor"></a>
                    <a class="token" href="#/s:10ChatLayout8ItemKindO">ItemKind</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Type of the item supported by <code><a href="Classes/CollectionViewChatLayout.html">CollectionViewChatLayout</a></code></p>

                        <a href="Enums/ItemKind.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ItemKind</span> <span class="p">:</span> <span class="kt">CaseIterable</span><span class="p">,</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">Sendable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:10ChatLayout8ItemSizeO"></a>
                    <a name="//apple_ref/swift/Enum/ItemSize" class="dashAnchor"></a>
                    <a class="token" href="#/s:10ChatLayout8ItemSizeO">ItemSize</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Represents desired item size.</p>

                        <a href="Enums/ItemSize.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ItemSize</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">Sendable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:10ChatLayout0A13ItemAlignmentO"></a>
                    <a name="//apple_ref/swift/Enum/ChatItemAlignment" class="dashAnchor"></a>
                    <a class="token" href="#/s:10ChatLayout0A13ItemAlignmentO">ChatItemAlignment</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Represent item alignment in collection view layout</p>

                        <a href="Enums/ChatItemAlignment.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ChatItemAlignment</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">Sendable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:10ChatLayout0A15ItemPinningTypeO"></a>
                    <a name="//apple_ref/swift/Enum/ChatItemPinningType" class="dashAnchor"></a>
                    <a class="token" href="#/s:10ChatLayout0A15ItemPinningTypeO">ChatItemPinningType</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Represents pinning behavour of the element.</p>

                        <a href="Enums/ChatItemPinningType.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ChatItemPinningType</span> <span class="p">:</span> <span class="kt">Hashable</span><span class="p">,</span> <span class="kt">Sendable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:10ChatLayout28InitialAttributesRequestTypeO"></a>
                    <a name="//apple_ref/swift/Enum/InitialAttributesRequestType" class="dashAnchor"></a>
                    <a class="token" href="#/s:10ChatLayout28InitialAttributesRequestTypeO">InitialAttributesRequestType</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Represents the point in time when <code><a href="Classes/CollectionViewChatLayout.html">CollectionViewChatLayout</a></code> asks about layout attributes modification.</p>

                        <a href="Enums/InitialAttributesRequestType.html" class="slightly-smaller">See more</a>
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">InitialAttributesRequestType</span> <span class="p">:</span> <span class="kt">Hashable</span></code></pre>

                        </div>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </section>

      </article>
    </div>
    <section class="footer">
      <p>&copy; 2025 <a class="link" href="https://github.com/ekazaev" target="_blank" rel="external noopener">Evgeny Kazaev</a>. All rights reserved. (Last updated: 2025-07-30)</p>
      <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.15.3</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
    </section>
  </body>
</html>
